package com.shen.computer;

/**
 * Author:shen
 * CreateDate:2020/5/7.
 * Function:
 */
public class Computer {
    private String color;
    private String brand;
    private double price;
    private String sign;
    public void count(int num1,int num2,String sign){
        double sum=0;
           switch (sign.trim()){
               case "+":
                   sum=num1+num2;
                   break;
               case "-":
                   sum=num1-num2;
                   break;
               case "*":
                   sum=num1*num2;
                   break;
               case "/":
                   sum=num1/num2;
                   break;
           }
        System.out.println("结果为："+sum);
    }
    public void cubic(int num){
        System.out.println(Math.pow(num, 3));
    }
    public Computer() {
    }

    public Computer(String color, String brand, double price) {
        this.color = color;
        this.brand = brand;
        this.price = price;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Computer{" +
                "color='" + color + '\'' +
                ", brand='" + brand + '\'' +
                ", price=" + price +
                '}';
    }
}
